﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp
{
    public partial class Form14 : Form
    {
        public Form14()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            string path = textBox1.Text;
            if (Directory.Exists(path))
            {
                MessageBox.Show(path + "目录以及存在");
            }
            else {
                Directory.CreateDirectory(path);
                MessageBox.Show(path + "目录创建成功");
            }
        }

        public void dirList(DirectoryInfo directory) {
            listBox1.Items.Clear();
            DirectoryInfo[] directoryInfos = directory.GetDirectories();
            for (int i = 0; i < directoryInfos.Length; i++) {
                listBox1.Items.Add(directoryInfos[i]);
            }
        }

       
    }
}
